<template>
  <div class="basic-table">
      <template>
    <el-table
      :data="tableData"
      style="width: 100%" border>
      <el-table-column
        prop="ctime"
        label="日期"
        width="180">
      </el-table-column>
      <el-table-column
        prop="name"
        label="姓名"
        width="180">
      </el-table-column>
      <el-table-column
        prop="city"
        label="地址"
        width="200">
      </el-table-column>
    </el-table>
  </template>
  </div>
</template>
<script>
    export default {
      created() {
        this.getTables();
      },
      data() {
        return {
          tableData: []
        }
      },
      methods:{
        //得到表格数据
        getTables() {
          this.$http.get('/api/table')
          .then(res => {
            console.log(res.data);
            this.tableData = res.data.tables;
          }).catch(err => {
            console.log(err)
          })
        }
      }
    }
  </script>


